{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "from numpy import random\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "import numpy as np\n",
    "from scipy import stats"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOKklEQVR4nO3df4yk9V3A8ffHO+gPqOmdLOQE4oK5VEmjhWwqiuGPUpSC8WjSJpi0uRjM/VOUGo3Zpomt/6HRRv8wTc5Sc1FS0lAMFy/RXs4S4z/UBQ4KveLR9qSU826rqa3+0Rb78Y95rrcss7dzuzPzPJ/neb+Szcw8O8t+5jvzvOfZ2ZslMhNJUj0/1vYAkqStMeCSVJQBl6SiDLgkFWXAJamonfP8ZldccUUuLi7O81tKUnlPPvnktzJzYf32uQZ8cXGRlZWVeX5LSSovIv593HZfQpGkogy4JBVlwCWpKAMuSUUZcEkqyoBLUlEGXJKKMuCSVJQBl6SiBhPwxeUjLC4faXsMSZqawQRckvrGgEtSUQZckooy4JJUlAGXpKIMuCQVZcAlqSgDLklFGXBJKmoQAV/7DkzfjSmpLwYRcEnqIwMuSUUZcEkqyoBLUlEGXJKKMuCSVNREAY+I342I5yPiuYj4TES8MSJ2R8TRiDjZnO6a9bCSpPM2DXhEXA38DrCUmW8HdgD3AMvAsczcCxxrLkuS5mTSl1B2Am+KiJ3Am4FXgH3Aoebzh4C7pz6dJGlDmwY8M78J/CnwEnAa+O/M/DxwVWaebq5zGrhy3NdHxIGIWImIldXV1elNLkkDN8lLKLsYHW1fB/wkcFlEfGDSb5CZBzNzKTOXFhYWt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ifAcnN+Gfjjlma7FbgJeG6z2Rj9OYRngDcA1zVrvqPFOT8O/P6Y67Y55x7gpub8W4B/a+bp1JpeYM5OrSmj95Jc3py/BHgCuLlr67nJrK2uaYUj8B+9ZT8zvw+ce8t+l+0DDjXnDwF3tzFEZv4z8F/rNm802z7g4cz8XmZ+HXiR0dq3NedG2pzzdGY+1Zz/LnACuJqOrekF5txIW3NmZv5Pc/GS5iPp2HpuMutG5jJrhYBfDXxjzeWXufCDcd4S+HxEPNn82QCAqzLzNIx2JuDK1qZ7vY1m6+I63xcRzzYvsZz7MboTc0bEInAjoyOxzq7pujmhY2saETsi4jhwFjiamZ1dzw1mhRbXtELAJ3rLfotuycybGP1Vxg9FxK1tD7RFXVvnTwI/DbwDOA38WbO99Tkj4nLgc8CHM/M7F7rqmG1zm3XMnJ1b08z8v8x8B6N3cr8zIt5+gau3up4bzNrqmlYIeKffsp+ZrzSnZ4G/Y/Rj0pmI2APQnJ5tb8LX2Wi2Tq1zZp5pdpgfAn/F+R8/W50zIi5hFMWHMvPRZnPn1nTcnF1d02a2bwOPA3fQwfVca+2sba9phYB39i37EXFZRLzl3HngV4DnGM23v7nafuCxdiYca6PZDgP3RMQbIuI6YC/wxRbmA360457zXkbrCi3OGREBPAicyMxPrPlUp9Z0ozm7tqYRsRARb23Ovwl4N/AVOraeF5q19TWdx29wt/sB3MnoN+lfBT7a9jxr5rqe0W+anwGePzcb8BPAMeBkc7q7pfk+w+jHuh8wOiK490KzAR9t1vgF4D0tz/k3wJeAZ5udYU8H5vxlRj8GPwscbz7u7NqaXmDOTq0p8HPA0808zwF/2Gzv1HpuMmura+pb6SWpqAovoUiSxjDgklSUAZekogy4JBVlwCWpKAMuSUUZcEkq6v8BmU3gE0oqPi8AAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from scipy import stats\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "\n",
    "X=range(120)\n",
    "Y=[]\n",
    "for k in X:\n",
    "    p = stats.poisson.pmf(k, 20)*1000\n",
    "    Y.append(p)\n",
    "\n",
    "\n",
    "X1 = range(120,240)\n",
    "Y1 = []\n",
    "for k in X1:\n",
    "    p = stats.poisson.pmf(k, 120+40)*1000\n",
    "    Y1.append(p)\n",
    " \n",
    "X2 = range(240,360)\n",
    "Y2 = []\n",
    "for k in X2:\n",
    "    p = stats.poisson.pmf(k, 240+60)*1000\n",
    "    Y2.append(p)\n",
    "\n",
    "x = np.concatenate((X,X1,X2))\n",
    "y = np.concatenate((Y,Y1,Y2))\n",
    "\n",
    "plt.bar(x, y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABO0AAACnCAYAAABNV6gHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAUEklEQVR4nO3dX4yl510f8O+v3oQ/CRV2vXZdO+o4yKKNUCHRKk2bKhcYlxAj7F6k8gVoVaXyDVCoWlWDkIDeuVWLwkWF5BKqbRuRopDKFosAa9uo4iZknTjBYXFtwjYxWbxLW8qfCyDk6cW8S8fbnZkzM+fP85z385FGM+fMGc/Xz/Oe93vOb8/MVGstAAAAAEA//sKmAwAAAAAAr2doBwAAAACdMbQDAAAAgM4Y2gEAAABAZwztAAAAAKAzhnYAAAAA0Jkz6/xmd999d9vZ2VnntwRgQc8///zvttbObjpHr3QYQL902OF0GEDfDuqxtQ7tdnZ2cvny5XV+SwAWVFX/Y9MZeqbDAPqlww6nwwD6dlCP+fFYAAAAAOiMoR0AAAAAdMbQDgAAAAA6Y2gHAAAAAJ0xtAOAwezsXtx0BAA4Nv0FcDyGdgAAAADQGUM7A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HtNhq6fDtt5Ie6bDNmOI+/qIHZaM1WMjdljSd4+NMrSr21x32ORz097dWntHku9I8r1V9Z5NB1qCnvfgJ5N8Q5JvSXItyb+eru8qc1W9OcnPJfnB1trvH3bT21zXU+7u17u19mettW9J8kCSd1bVNx1y8y5yH5C5+7VmIaPtlw5br2Hu5yP2mA5bDx229UbaMx22fkPc10fssGS8Hhuxw5K+e2yUod2rSd6y7/IDSb60oSxHaq19aXp/Pcl/zt5LJV+rqvuSZHp/fXMJD3VQzm73oLX22nQn+0qSf5v/99LUbjJX1Ruyd7L9cGvtY9PV3a/17XKPsN43tdZ+L8nHk7w3A6x38vrMI601hxpqv3TYeo1yPx+xx3TY+umwrTXMnumw9Rvhvj5ihyVj99iIHZb02WOjDO0+meShqnqwqt6Y5Ikkz244021V1Zuq6utufpzk7yZ5MXt5z083O5/kmc0kPNJBOZ9N8kRVfVVVPZjkoSS/uoF8/5+bJ4DJ38veeiedZK6qSvKhJFdaaz++71Ndr/VBuQdY77NV9fXTx1+T5NuS/EY6Xu+DMve+1ixMh61Pt/fzg4xwPx+xx3TY5jP3vtYcyxA9psM2o/f7+ogdlozZYyN22JS17x5ra/7LHCd9S/K+7P3FlN9M8sObznNIzrdm7y+JfCbJ525mTfKXklxK8vL0/q4Osv5M9l7m+afZmxZ/4LCcSX54Wv+XknxHR5n/Q5JfS/LZ7N2B7uss89/J3stlP5vkhentfQOs9UG5e1/vv5Hk01O+F5P8yHR9t+t9SOau19rbsfZYhy0/qw5bX+7hekyHdZG567X2dux97r7HdNjGcnd9Xx+xw47I3e16j9hhR+TuYq1r+oYAAAAAQCdG+fFYAAAAAJgNQzsAAAAA6IyhHQAAAAB0xtAOAAAAADpjaAcAAAAAnTG0AwAAAIDOGNoBAAAAQGcM7QAAAACgM/8X8G2aixkWm6oAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 1584x180 with 3 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "r1 =list(range(0,20)) \n",
    "r2= list(range(120,160))\n",
    "r3 = list(range(240,300))\n",
    "\n",
    "reverse = np.concatenate((r1,r2,r3))\n",
    "y_burst = y.copy()\n",
    "y_burst_reverse = y.copy()\n",
    "for i in reverse:\n",
    "    y_burst[i] = 0\n",
    "\n",
    "for i in range(360):\n",
    "    if i not in reverse:\n",
    "        y_burst_reverse[i] = 0\n",
    "\n",
    "f, (ax1, ax2,ax3) = plt.subplots(1,3,figsize=(22, 2.5))\n",
    "\n",
    "ax1.bar(x=x,height=y)\n",
    "ax2.bar(x=x,height=y_burst)\n",
    "ax3.bar(x=x,height=y_burst_reverse)\n",
    "\n",
    "plt.show()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def workload_generator(triffic=30, times=200):\n",
    "    X = range(triffic)\n",
    "    Y = []\n",
    "    X1 = range(triffic, 2*triffic)\n",
    "    Y1 = []\n",
    "    X2 = range(2*triffic, 3*triffic)\n",
    "    Y2 = []\n",
    "    for k in X:\n",
    "        p = stats.poisson.pmf(k, int(triffic/5)) * times\n",
    "        Y.append(p)\n",
    "\n",
    "    for k in X1:\n",
    "        p = stats.poisson.pmf(k, int(triffic+triffic/4)) * times\n",
    "        Y1.append(p)\n",
    "\n",
    "    for k in X2:\n",
    "        p = stats.poisson.pmf(k, int(2*triffic + triffic/2)) * times\n",
    "        Y2.append(p)\n",
    "\n",
    "    x = np.concatenate((X, X1, X2))\n",
    "    y = np.concatenate((Y, Y, Y))\n",
    "    y = list(np.floor(y))\n",
    "\n",
    "    r1 = range(6, 20)\n",
    "    r3 = range(60, 66)\n",
    "\n",
    "    for i in r1:\n",
    "        y[i] = 0\n",
    "    for i in r3:\n",
    "        y[i] = 0\n",
    "\n",
    "    return x, y\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABPUAA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NqAalqs5I8ookD880yvVrM++fEzVsEjVsMnVseerY8tSwk7fiffRgjtTr7qNV9Z4kt2Z0V5VruvuBOYe1HrwhyduT3FdV94zHPpBkf5LPVtWVGX1w3jqf8NY1OTrWe5N8erwTfjij/6T8ROQp3X1nVX0uydcyupjrnyU5kNEFXjd9fjaK49WaqrpqvPzqjO70dkmSQ0l+mNHnZFOYMj+/leSnk3x8/F/8o929e14xz9KU+dm0pslPdz9YVV9Mcm9G18H9RHffP7+oZ2vK99AHk1xbVfdldJrO+7v7qbkFPUNV9Zkkb0xyelUdTvLbSZ6X2D8natgkathk6tjy1LHlqWGTrUUdq9FRjwAAAADAUAzp9FsAAAAAIJp6AAAAADA4mnoAAAAAMDCaegAAAAAwMJp6AAAAADAwmnoAAAAAMDCaegAAAAAwMJp6AAAAADAw/w8vouUwjQ9FCgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 1584x180 with 3 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x, y= workload_generator(30, 200)\n",
    "f, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(22, 2.5))\n",
    "\n",
    "ax1.bar(x=x, height=y)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "range(75, 90)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "triffic=30\n",
    "times=200\n",
    "\n",
    "\n",
    "X = range(triffic)\n",
    "Y = []\n",
    "X1 = range(triffic, 2*triffic)\n",
    "Y1 = []\n",
    "X2 = range(2*triffic, 3*triffic)\n",
    "Y2 = []\n",
    "for k in X:\n",
    "    p = stats.poisson.pmf(k, int(triffic/5)) * times\n",
    "    Y.append(p)\n",
    "\n",
    "for k in X1:\n",
    "    p = stats.poisson.pmf(k, int(triffic+triffic/4)) * times\n",
    "    Y1.append(p)\n",
    "\n",
    "for k in X2:\n",
    "    p = stats.poisson.pmf(k, int(2*triffic + triffic/2)) * times\n",
    "    Y2.append(p)\n",
    "\n",
    "x = np.concatenate((X, X1, X2))\n",
    "y = np.concatenate((Y, Y, Y))\n",
    "y = list(np.floor(y))\n",
    "\n",
    "r1 =range(0,int(triffic/2))\n",
    "r3 = range(int(2*triffic + triffic/2),3*triffic)\n",
    "r3 \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "9aab921455daf93c5b5e512768862be38eb2d6dcc418fdb7d8b034605503ac32"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8 64-bit ('base': conda)",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
